import { defineStore } from "pinia";
import { store } from "@/store";
import { getConfig } from "@/config";

export const useSettingsStore = defineStore("settings-store", {
  state: () => ({
    fixedHeader: getConfig().FixedHeader,
    hiddenSideBar: getConfig().HiddenSideBar
  }),
  getters: {
    getFixedHeader: (state) => state.fixedHeader,
    getHiddenSideBar: (state) => state.hiddenSideBar
  },
  actions: {
    setFixedHeader(value) {
      this.fixedHeader = value;
    },
    setHiddenSideBar(value) {
      this.hiddenSideBar = value;
    }
  }
});

export function useSettingStoreHook() {
  return useSettingsStore(store);
}
